
import UIKit

class FFStreetRace: NSObject {

    /// oxide: en， es
    /// applydate -> ally
    /// duedata -> enemy
    /// loandata -> attack
    /// repaydate -> hideout
    func acceleration(_ engine: Int, oxide: String, ally: String, enemy: String, attack: String, hideout: String) -> FFRaceModel {
        switch engine {
        case 10, 30, 31, 32, 36, 50, 99:
            return FFRaceModel(brakesText: circuitRace(oxide),
                               brakesValue: ally,
                               rubberText: circuitRaceTwo(oxide),
                               rubberValue: enemy)
        case 60, 61:
            return FFRaceModel(brakesText: circuitRaceThree(oxide),
                               brakesValue: attack,
                               rubberText: circuitRaceTwo(oxide),
                               rubberValue: enemy)
        case 70:
            return FFRaceModel(brakesText: circuitRaceThree(oxide),
                               brakesValue: attack,
                               rubberText: circuitRaceThese(oxide),
                               rubberValue: hideout)
        default:
            return FFRaceModel(brakesText: "--", brakesValue: "--", rubberText: "--", rubberValue: "--")
        }
    }
    
    private func circuitRace(_ oxide: String) -> String {
        switch oxide {
        case "en":
            return "Date of application"
        case "es":
            return "Fecha de solicitud"
        default:
            return "--"
        }
    }
    
    private func circuitRaceTwo(_ oxide: String) -> String {
        switch oxide {
        case "en":
            return "Due date"
        case "es":
            return "Fecha de vencimiento"
        default:
            return "--"
        }
    }
    
    private func circuitRaceThree(_ oxide: String) -> String {
        switch oxide {
        case "en":
            return "Payment date"
        case "es":
            return "Fecha de desembolso"
        default:
            return "--"
        }
    }
    
    private func circuitRaceThese(_ oxide: String) -> String {
        switch oxide {
        case "en":
            return "Repayment date"
        case "es":
            return "Fecha de reembolso"
        default:
            return "--"
        }
    }
}


